from django.db import models

# Create your models here.
class JosBanner(models.Model):
    bid = models.IntegerField(primary_key=True)
    cid = models.IntegerField()
    type = models.CharField(max_length=30)
    name = models.CharField(max_length=255)
    alias = models.CharField(max_length=255)
    imptotal = models.IntegerField()
    impmade = models.IntegerField()
    clicks = models.IntegerField()
    imageurl = models.CharField(max_length=100)
    clickurl = models.CharField(max_length=200)
    date = models.DateTimeField(null=True, blank=True)
    showbanner = models.IntegerField(db_column='showBanner') # Field name made lowercase.
    checked_out = models.IntegerField()
    checked_out_time = models.DateTimeField()
    editor = models.CharField(max_length=50, blank=True)
    custombannercode = models.TextField(blank=True)
    catid = models.IntegerField()
    description = models.TextField()
    sticky = models.IntegerField()
    ordering = models.IntegerField()
    publish_up = models.DateTimeField()
    publish_down = models.DateTimeField()
    tags = models.TextField()
    params = models.TextField()
    class Meta:
        db_table = u'jos_banner'

class JosBannerclient(models.Model):
    cid = models.IntegerField(primary_key=True)
    name = models.CharField(max_length=255)
    contact = models.CharField(max_length=255)
    email = models.CharField(max_length=255)
    extrainfo = models.TextField()
    checked_out = models.IntegerField()
    checked_out_time = models.TextField(blank=True) # This field type is a guess.
    editor = models.CharField(max_length=50, blank=True)
    class Meta:
        db_table = u'jos_bannerclient'

class JosBannertrack(models.Model):
    track_date = models.DateField()
    track_type = models.IntegerField()
    banner_id = models.IntegerField()
    class Meta:
        db_table = u'jos_bannertrack'

